1
生成式建模導論:超越分類的範疇
EvoClass-AI003Lecture 8
00:00

生成式建模導論:超越分類的範疇

我們正從 判別式建模轉向,這種方法透過學習條件機率 $P(y|x)$ 來解決分類與迴歸問題,進而進入更複雜的 生成式建模領域。現在我們的核心目標轉變為 密度估計:學習訓練資料 $X$ 所源自的完整基礎資料分布 $P(x)$。此根本性的轉變使我們能捕捉高維資料集內錯綜複雜的依賴關係與結構,不再僅止於邊界區分,而是真正理解資料並進行創造性合成。

1. 生成式的目標:建模 $P(x)$

生成式模型的目標是估算訓練資料 $X$ 所源自的機率分布 $P(x)$。一個成功的生成式模型可執行三大關鍵任務:(1) 密度估計(為輸入 $x$ 分配機率分數),(2) 抽樣(產生全新的資料點 $x_{new} \sim P(x)$),以及 (3) 無監督特徵學習(在潛在空間中發現有意義且解耦的表示)。

2. 分類:顯式與隱式似然

生成式模型的根本區分在於其對似然函數的處理方式。 顯式密度模型,例如 變分自編碼器(VAEs) 與流模型,會定義數學上的似然函數,並試圖最大化它(或其下界)。 隱式密度模型,最著名的例子是 生成對抗網路(GANs)則完全跳過似然計算,改以對抗訓練框架學習一個映射函數,從分布 $P(x)$ 中抽樣。

Question 1
In generative modeling, what is the primary distribution of interest?
$P(x)$
$P(y|x)$
$P(x|y)$
$P(y)$
Question 2
Which type of generative model relies on adversarial training and avoids defining an explicit likelihood function?
Variational Autoencoder (VAE)
Autoregressive Model
Generative Adversarial Network (GAN)
Gaussian Mixture Model (GMM)
Challenge: Anomaly Detection
Leveraging Density Estimation
A financial institution has trained an explicit density generative model $G$ on millions of legitimate transaction records. A new transaction $x_{new}$ arrives.

Goal: Determine if $x_{new}$ is an anomaly (fraud).
Step 1
Based on the density estimate of $P(x)$, what statistical measure must be evaluated for $x_{new}$ to flag it as anomalous?
Solution:
The model must evaluate the probability (or likelihood) $P(x_{new})$. If $P(x_{new})$ falls below a predefined threshold $\tau$, meaning the new point is statistically improbable under the learned distribution of normal transactions, it is flagged as an anomaly.